﻿using System;
using System.DHTML;
using Sys;
using Sys.UI;
using Sys.Mvc;

using JQuerySharp;

using VietPublisher.Scripts.Resources;




static public class Book_Script
{
    public static string ControllerUrl = "Book";

    #region popup
    public static void popupAuthor(string authorNames)
    {

        //step 1 : pass param to action in AuthorController
        string href = SC_Common.BasePath + "author" + string.Format("/OpenAuthorPopup?authorNames={0}", authorNames);
        Utils.OpenWinCenter("PopupAuthor", href, 650, 800);
    }
    public static void popupPublisher()
    {

        //step 1 : pass param to action in AuthorController
        string href = SC_Common.BasePath + "Publisher" + string.Format("/OpenPublisherPopup");
        Utils.OpenWinCenter("PopupPublisher", href, 300, 400);
    }
    public static void popupCategory()
    {

        //step 1 : pass param to action in AuthorController
        string href = SC_Common.BasePath + "Category" + string.Format("/OpenCategoryPopup");
        Utils.OpenWinCenter("PopupCategory", href, 300, 400);
    }
    public static void OpenPopupChooseImage()
    {
        string href = SC_Common.BasePath + ControllerUrl + string.Format("/OpenPopupChooseImage");
        Utils.OpenWinCenter("PopupImage", href, 200, 200);
    }

    #endregion

    #region validate

    public static bool AddbookValidate()
    {
        ItemInfor[] items = new ItemInfor[] {
            new ItemInfor("Weight",false,10,null, ValueType.Interger, null),
            new ItemInfor("PageNumber",false,10,null, ValueType.Interger, null),
           new ItemInfor("Quantity",false,10,null, ValueType.Interger, null),
           new ItemInfor("PriceCurrent",false,10,null, ValueType.Number, null),
            
        };
        if (UIHelper.ValidateItems(items, false))
        {
            return true;
        }
        return false;

    }
    #endregion

    #region Get lists Book in slide show

    public static void GetBookSlideShow()
    {
        Script.Alert("vao");
        string href = SC_Common.BasePath + ControllerUrl + string.Format("/TopBookList&dt={0}", new DateTime());
        UIHelper.LoadAjax(href, "SlBook", null, null);
    }

    #endregion



}